import styles from './index.module.scss'
type Props = {
  hideList: () => void
  type: '' | 'gender' | 'photo'
  onUpdata: (key: string, value: string) => void
}
const EditList = ({ hideList, type, onUpdata }: Props) => {
  const genderList = [
    { title: '男', value: '0' },
    { title: '女', value: '1' },
  ]
  const photoList = [
    { title: '本地拍照', value: '' },
    { title: '本地選擇', value: '' },
  ]
  const list = type === 'gender' ? genderList : photoList
  return (
    <div className={styles.root}>
      {list.map(item => (
        <div className='list-item' key={item.title} onClick={() => onUpdata(type, item.value)}>
          {item.title}
        </div>
      ))}
      {/* {type === 'gender' ? (
        <>
          <div className='list-item'>男</div>
          <div className='list-item'>女</div>
        </>
      ) : (
        <>
          <div className='list-item'>本地拍照</div>
          <div className='list-item'>本地選擇</div>
        </>
      )} */}
      {/* <div className='list-item'>男</div>
      <div className='list-item'>女</div> */}

      <div className='list-item' onClick={hideList}>
        取消
      </div>
    </div>
  )
}

export default EditList
